package team.zero.lemon.common.utils;

import com.google.gson.Gson;

/**
 * Created by fangpingxi on 2017/9/23.
 */
public class JsonUtils {


    public static <T> String ObjectToJson(T object) {
        Gson gson = new Gson();
        String json = gson.toJson(object);
        return json;
    }

    public static <T> T JsonToObject(String json, Class<T> classType) {
        Gson gson = new Gson();
        T object = gson.fromJson(json, classType);
        return object;
    }
}
